<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box {
        width: 200px;
        height: 300px;
        overflow-y: scroll;
        background: pink;
      }
    </style>
  </head>
  <body>
    <div class="box">
      <h1>123</h1>
      <h1>123</h1>
      <h1>123</h1>
      <h1>123</h1>
      <h1>123</h1>
      <h1>123</h1>
      <h1>123</h1>
      <h1>123</h1>
      <h1>123</h1>
      <h1>123</h1>
      <h1>123</h1>
      <h1>123</h1>
      <h1>123</h1>
      <h1>123</h1>
    </div>
    <script>
      document.querySelector(".box").addEventListener("scroll",function(){
        //   console.log(123);
          let scrollHeight = this.scrollHeight
          let clientHeight = this.clientHeight
          let scrollTop = this.scrollTop
          console.log(scrollHeight,clientHeight,scrollTop);
          //scrollHeight = clientHeight + scrollTop
      })
    
    </script>
  </body>
</html>
